﻿{include file=header.html}
<script type="text/javascript">
function sbumit_customer_reviews()
{
	var mainFrame = window.parent.frames["mainFrame"];;
	var id="customer_reviews";
	if (mainFrame != undefined) 
	{
		mainFrame.document.getElementById(id).innerHTML += '<a>test</a><br />';
	}
	window.parent.unblock();
}
</script>
<body>
<form method="post" action="{url app=comupload&act=customer_reviews}{if $smarty.get.id}&id={$smarty.get.id}{/if}" enctype="multipart/form-data">
<div class="sub-body" style="width:390px;">
  <h3 class="title-1">{$lang.upload_pic}</h3>
{$lang.select_pic}：<input type="file" name="customer_reviews[]" class="input-2" hidefocus="true" />
<br />
<br />
<input type="button" class="btn-2" value="继续添加" onClick="add_file(this);" />
<br />
<br />
<div style="text-align:center;"><!-- /* 提交按钮加入onClick="this.disabled='disabled'"，以防二次提交上传 */ -->
  <input type="button" class="btn-4" value="{$lang.submit}" onClick="sbumit_customer_reviews();" />
</div>
</div>
</form>
<script type="text/javascript" language="javascript">
function add_file(obj) {
	var parent = obj.parentNode;
	var span = document.createElement('span');
	span.innerHTML = '{$lang.select_docs}：<input type="file" name="customer_reviews[]" class="input-2" hidefocus="true" /><a href="" onclick="remove_file(this);return false;" class="pic_del">移除</a><br /><br />';
	parent.insertBefore(span, obj);
}
function remove_file(obj) {
	var parent = obj.parentNode.parentNode;
	parent.removeChild(obj.parentNode);
}
</script>
</body>
</html>
